
(let ((z (identifierN 8)))
  (map (lambda (i) (z)) (iota 12))) 

;; => (9 10 11 12 13 14 15 16 17 18 19 20)

(let ((z (identifierC 8 12)))
  (map (lambda (i) (z)) (iota 12))) 

;; => (8 9 10 11 12 8 9 10 11 12 8 9)

;; Runs in circles, releasing identifiers roughly half as often as
;; they are reserved.

(let ((r (make-resource-id 6))
      (l (list)))
  (do ((i 0 (+ i 1)))
      ((= i 16) 'MADE-IT)
    (let ((id (resource-id-reserve r)))
      (inform "Reserve:" id)
      (set! l (append l (list id)))
      (if (> (random-uniform) 0.5)
	  (begin (resource-id-release r (car l))
		 (inform "Release:" (car l))
		 (set! l (cdr l)))))))

;; Reserving two IDs for long lived objects, and cycling through other
;; IDs.

(let ((r (make-resource-id 6)))
  (resource-id-reserve r)
  (resource-id-reserve r)
  (map (lambda (n) (resource-id-next r)) 
       (iota 8)))			; => (2 3 4 5 2 3 4 5)


